<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>显示所有学生的信息</title>
    <link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        img{
            border-radius: 5px;
            padding: 5px;
            width: 180px;
            border:1px dashed gray;
        }
    </style>
</head>

<body>
<div class="container">
    <table class="table table-bordered table-hover table-striped">
        <thead>
        <tr>
            <th>序号</th>
            <th>账号</th>
            <th>姓名</th>
            <th>照片</th>
            <th>出生日期</th>
            <th>注册时间</th>
            <th>注册IP</th>
            <th>基本操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${data}" var="s">
            <tr>
                <td>${s.id}</td>
                <td>${s.account}</td>
                <td>${s.name}</td>
                <td><img src="${s.photo}"></td>
                <td>${s.birthday}</td>
                <td>${s.create_time}</td>
                <td>${s.sip}</td>

                <td>
                    <c:if test="${sessionScope.user == s.account}">
                    <a href="/del.do?id=${s.id}" class="btn btn-small btn-danger">删除</a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="100">
                    ${pageinfo}
                    <%--<a href="?p=1">首页</a>--%>
                    <%--<a href="?p=${cp+1}">下一页</a>--%>
                    <%--<a href="?p=${cp-1}">上一页</a>--%>
                    <%--<a href="?p=${pc}">末页</a>--%>
                    <%--<hr>--%>
                    <%--[第${cp}页/共${pc}页][每页${ps}条，共${rc}条]--%>
                    <%--<br>--%>
                    <%--<%--%>
                    <%--    for(int i = 1; i <= (Integer)request.getAttribute("pc");i++){--%>
                    <%--        out.print(String.format("<a href='?p=%d'>第%<d页</a>&nbsp;",i));--%>
                    <%--    }--%>

                    <%--%>--%>


                </td>
            </tr>
        </tfoot>
    </table>
</div>
<hr>
${sessionScope.user}
</body>
</html>
